1. Field of the Invention
The present invention relates to a method and apparatus for generating an image based on image data that is transmitted in a compressed form or drawing data of computer graphics. In particular, the invention relates to an image generating method and apparatus suitable for use in cases where high visualization performance needs to be attained using limited hardware resources, for instance, in equipment utilizing computer graphics such as video game machines and graphic computers.
2. Description of the Related Art
In a system that is generally called a 3D (three-dimensional) graphic system in computer graphics, to draw an object (drawing object) with reality, i.e., to reconstruct an stereoscopic image, the object surface is decomposed into a plurality of polygons (i.e., smallest units (triangles and tetragons) of figures handled by a drawing device), and then the polygons are sequentially drawn on a frame memory (video RAM) that corresponds to the display screen of a monitor.
In this type of image generating apparatus, to enable fast processing, a dedicated drawing device is usually provided between a CPU and a frame memory. In generating an image, the CPU generates instructions (hereinafter called drawing instructions) for drawing fundamental figures such as triangles and tetragons (polygons) and sends those instructions to the drawing device rather than directly accesses the frame memory. The drawing device interprets the received instructions and draws an image on the frame memory.
FIGS. 19A and 19B illustrates a specific example of a drawing method. To display an object that is a rectangular parallelepiped having apices A-G as shown in FIG. 19A, first the object is decomposed into three tetragons, i.e., polygons Pa, Pb and Pc as shown in FIG. 19B.
Then, as shown in FIG. 20, the CPU generates drawing instructions IPa, IPb and IPc corresponding to the polygons Pa, Pb and Pc. Each of the drawing instructions IPa, IPb and IPc consists of apex coordinates (Ax, AF)-(Dx, Dy), (Cx, Cy)-(Fx, Fy) or (Bx, By)-(Gx, Gy) of the polygon Pa, Pb or Pc for determining display positions on the display screen and information OD indicating a color inside the polygon Pa, Pb or Pc.
The drawing device draws the object on the frame memory based on the above drawing instructions. The object is displayed at the display position designated by the drawing instructions by converting the drawing data of the frame memory to an analog signal and supplying it to a display device (monitor).
By the way, a common method of transferring drawing instructions to the drawing device is to employ DMA (direct memory access) to enable fast transfer.
However, in this type of conventional image generating apparatus, only part of data that are stored in the frame memory, such as drawing instructions and image data, are DMA-transferred. For example, control instructions that are necessary before drawing, such as instructions for clearing the screen and changing resolution, cannot be DMA-transferred but are transferred independently of drawing instructions. Therefore, the drawing device needs to have separate and independent receiving sections for drawing instructions and control instructions.
Further, separate transfer of drawing instructions and control instructions requires complex processing. For example, to change resolution after drawing a certain object, the conventional scheme needs the following complex processing. The CPU waits for drawing completion while always monitoring the operation of drawing the object. Upon detecting the completion of drawing the object, the CPU Stops DMA transfer of drawing data, changes resolution, and then restarts the DMA transfer of drawing data.
To simplify the structures of the drawing device and a DMA controller as a transfer device that are used for the above type of DMA transfer, one approach is to make the DMA transfer data such as drawing instructions have form of a fixed-length packet (transfer unit). In this case, the packet should not be shorter than the maximum length of the DMA transfer data such as drawing instructions. However, if drawing instructions that are shorter than the packet are frequently used, there occur many inefficient transfer operations.
For example, where DAM transfer instruction data have various data lengths (hatched in FIGS. 21A-21C) like instructions 1-3, the packet length is made equal to the maximum data length as shown in FIGS. 21A-21C. An empty portion of instruction data that is shorter than the packet is filled with an inoperative code NOP, for instance. FIG. 22 shows transfer and drawing processing times in such a case. It is understood that transfer times of inoperative codes NOP are consumed in vain.
In view of the above, a first object of the present invention is to allow control data to be transferred together with drawing data. A second object of the invention is to enable DMA transfer of data whose data lengths are not fixed.
U.S. Pat. No. 5,133,025 relates to the DMA of the invention. Further, Japanese Patent Application Nos. Hei. 5-190764 (filed Jul. 2, 1993), Hei. 5-258625 (filed Oct. 15, 1993) and Hei. 6-27405 (filed Jan. 31, 1994) relate to the drawing device of the invention. Each of these Japanese applications was filed by the present assignee and is hereby incorporated by reference. U.S. patent applications corresponding to these three Japanese applications are now pending.